<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        
        
        
        <link rel="shortcut icon" href="../../img/favicon.ico">

	<title>Pythonscript - My Docs</title>

        <link href="../../css/bootstrap-custom.min.css" rel="stylesheet">
        <link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
        <link href="../../css/base.css" rel="stylesheet">
        <link rel="stylesheet" href="../../css/highlight.css">
        <link href="../../site/site/css/base.css" rel="stylesheet">
        <link href="../../site/site/css/bootstrap-custom.min.css" rel="stylesheet">
        <link href="../../site/site/css/font-awesome-4.0.3.css" rel="stylesheet">
        <link href="../../site/site/css/highlight.css" rel="stylesheet">
        <link href="../../site/css/base.css" rel="stylesheet">
        <link href="../../site/css/bootstrap-custom.min.css" rel="stylesheet">
        <link href="../../site/css/font-awesome-4.0.3.css" rel="stylesheet">
        <link href="../../site/css/highlight.css" rel="stylesheet">

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
            <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->

        
    </head>

    <body>

        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">

        <!-- Collapsed navigation -->
        <div class="navbar-header">
            
            <!-- Expander button -->
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            

            <!-- Main title -->
            <a class="navbar-brand" href="../concatenate/">My Docs</a>
        </div>

        <!-- Expanded navigation -->
        <div class="navbar-collapse collapse">
            
                <!-- Main navigation -->
                <ul class="nav navbar-nav">
                
                
                    <li class="dropdown active">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Data <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        
                            
<li >
    <a href="../concatenate/">Concatenate</a>
</li>

                        
                            
<li >
    <a href="../continuize/">Continuize</a>
</li>

                        
                            
<li >
    <a href="../datainfo/">Datainfo</a>
</li>

                        
                            
<li >
    <a href="../datasampler/">Datasampler</a>
</li>

                        
                            
<li >
    <a href="../datatable/">Datatable</a>
</li>

                        
                            
<li >
    <a href="../discretize/">Discretize</a>
</li>

                        
                            
<li >
    <a href="../editdomain/">Editdomain</a>
</li>

                        
                            
<li >
    <a href="../featureconstructor/">Featureconstructor</a>
</li>

                        
                            
<li >
    <a href="../file/">File</a>
</li>

                        
                            
<li >
    <a href="../paintdata/">Paintdata</a>
</li>

                        
                            
<li class="active">
    <a href="./">Pythonscript</a>
</li>

                        
                            
<li >
    <a href="../save/">Save</a>
</li>

                        
                            
<li >
    <a href="../selectcolumns/">Selectcolumns</a>
</li>

                        
                            
<li >
    <a href="../selectrows/">Selectrows</a>
</li>

                        
                        </ul>
                    </li>
                
                
                
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Visualize <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        
                            
<li >
    <a href="../../visualize/boxplot/">Boxplot</a>
</li>

                        
                            
<li >
    <a href="../../visualize/distributions/">Distributions</a>
</li>

                        
                            
<li >
    <a href="../../visualize/heat-map/">Heat map</a>
</li>

                        
                            
<li >
    <a href="../../visualize/modelmapprojectionrank/">Modelmapprojectionrank</a>
</li>

                        
                            
<li >
    <a href="../../visualize/scatterplot/">Scatterplot</a>
</li>

                        
                            
<li >
    <a href="../../visualize/sievediagram/">Sievediagram</a>
</li>

                        
                            
<li >
    <a href="../../visualize/venn-diagram/">Venn diagram</a>
</li>

                        
                        </ul>
                    </li>
                
                
                
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Docs <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        
                            
<li >
    <a href="../../docs/">Home</a>
</li>

                        
                        </ul>
                    </li>
                
                
                
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Classify <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                        
                            
<li >
    <a href="../../classify/logisticregression/">Logisticregression</a>
</li>

                        
                            
<li >
    <a href="../../classify/naivebayes/">Naivebayes</a>
</li>

                        
                        </ul>
                    </li>
                
                
                </ul>
            

            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
                        <i class="fa fa-search"></i> Search
                    </a>
                </li>
                
                    <li >
                        <a rel="next" href="../paintdata/">
                            <i class="fa fa-arrow-left"></i> Previous
                        </a>
                    </li>
                    <li >
                        <a rel="prev" href="../save/">
                            Next <i class="fa fa-arrow-right"></i>
                        </a>
                    </li>
                
                
            </ul>
        </div>
    </div>
</div>

        <div class="container">
            
                <div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
    <ul class="nav bs-sidenav">
    
        <li class="main active"><a href="#python-script">Python Script</a></li>
        
            <li><a href="#signals">Signals</a></li>
        
            <li><a href="#description">Description</a></li>
        
            <li><a href="#library">Library</a></li>
        
    
    </ul>
</div></div>
                <div class="col-md-9" role="main">

<h1 id="python-script">Python Script</h1>
<p><img alt="Python Script" src="../icons/python-script.png" /></p>
<h2 id="signals">Signals</h2>
<p><strong>Inputs</strong>:</p>
<ul>
<li><strong>in_data (Orange.data.Table)</strong></li>
</ul>
<p>Input data set bound to <code>in_data</code> variable in the script’s local namespace.</p>
<ul>
<li><strong>in_distance (Orange.core.SymMatrix)</strong></li>
</ul>
<p>Input symmetric matrix bound to <code>in_distance</code> variable in the script’s local namespace.</p>
<ul>
<li><strong>in_learner (Orange.classification.Learner)</strong></li>
</ul>
<p>Input learner bound to <code>in_learner</code> variable in the script’s local namespace.</p>
<ul>
<li><strong>in_classifier (Orange.classification.Learner)</strong></li>
</ul>
<p>Input classifier bound to <code>in_classifier</code> variable in the script’s local namespace.</p>
<ul>
<li><strong>in_object (object)</strong></li>
</ul>
<p>Input python object bound to <code>in_object</code> variable in the script’s local namespace.</p>
<p><strong>Outputs</strong>:</p>
<ul>
<li><strong>out_data (Orange.data.Table)</strong></li>
</ul>
<p>Data set retrieved from <code>out_data</code> variable in the script’s local namespace after execution.</p>
<ul>
<li><strong>out_distance (Orange.core.SymMatrix)</strong></li>
</ul>
<p>Symmetric matrix retrieved from <code>out_distance</code> variable in the script’s local namespace after execution.</p>
<ul>
<li><strong>out_learner (Orange.classification.Learner)</strong></li>
</ul>
<p>Learner retrieved from <code>out_learner</code> variable in the script’s local namespace.</p>
<ul>
<li><strong>out_classifier (Orange.classification.Learner)</strong></li>
</ul>
<p>Classifier retrieved from <code>out_classifier</code> variable in the script’s local namespace after execution.</p>
<ul>
<li><strong>out_object (object)</strong></li>
</ul>
<p>Python object retrieved from <code>out_object</code> variable in the script’s local namespace after execution.</p>
<h2 id="description">Description</h2>
<p><img alt="Python Script widget with an example script" src="../images/python-script-example.png" /></p>
<p><strong>Python Script</strong> widget can be used to run a python script in the inputs,
when a suitable functionality is not implemented in an existing widgets.
The scripts have <code>in_data</code>, <code>in_distance</code>, <code>in_learner</code>, <code>in_classifier</code>
and <code>in_object</code> variables (from input signals) in their local namespace.
If a signal is not connected or it did not yet receive any data, those
variables contain <code>None</code>.</p>
<p>After the script is executed <code>out_data</code>, <code>out_distance</code>, … variables
from the script’s local namespace are extracted and used as outputs of
the widget. The widget can be further connected to other widgets for visualizing the output.</p>
<p>For instance the following script would simply pass on all signals it
receives:</p>
<pre><code>out_data = in_data
out_distance = in_distance
out_learner = in_learner
out_classifier = in_classifier
out_object = in_object
</code></pre>
<blockquote>
<p><strong>Note</strong></p>
<p>You should not modify the input objects in place.</p>
</blockquote>
<p>The <em>Python script</em> editor on the left can be used to edit a script (it
supports some rudimentary syntax highlighting).</p>
<p>Pressing the <em>Execute</em> in the <em>Run</em> box executes the script (using <code>exec</code>).
Any script output (from <code>print</code>) is captured and displayed in the
<em>Console</em> below the script.</p>
<p>If <em>Auto execute</em> is checked, the script is run any time inputs to
the widget change.</p>
<h2 id="library">Library</h2>
<p>The <em>Library</em> control can be used to manage multiple scripts.</p>
<p>Pressing "+" will add a new entry and open it in the <em>Python script</em>
editor. When the script is modified its entry in the <em>Library</em> will
change to indicate it has unsaved changes. Pressing <em>Update</em> will save the
script (keyboard shortcut ctrl + s). A script can be removed by
selecting it and pressing the "-" button.</p></div>
            
        </div>

        <footer class="col-md-12">
            <hr>
            
            <p>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</p>
        </footer>

        <script src="../../js/jquery-1.10.2.min.js"></script>
        <script src="../../js/bootstrap-3.0.3.min.js"></script>
        <script src="../../js/highlight.pack.js"></script>
        <script>var base_url = '../..';</script>
        <script data-main="../../mkdocs/js/search.js" src="../../mkdocs/js/require.js"></script>
        <script src="../../js/base.js"></script>
        <script src="../../site/mkdocs/js/lunr-0.5.7.min.js"></script>
        <script src="../../site/mkdocs/js/mustache.min.js"></script>
        <script src="../../site/mkdocs/js/require.js"></script>
        <script src="../../site/mkdocs/js/search.js"></script>
        <script src="../../site/mkdocs/js/text.js"></script>
        <script src="../../site/site/mkdocs/js/lunr-0.5.7.min.js"></script>
        <script src="../../site/site/mkdocs/js/mustache.min.js"></script>
        <script src="../../site/site/mkdocs/js/require.js"></script>
        <script src="../../site/site/mkdocs/js/search.js"></script>
        <script src="../../site/site/mkdocs/js/text.js"></script>
        <script src="../../site/site/js/base.js"></script>
        <script src="../../site/site/js/bootstrap-3.0.3.min.js"></script>
        <script src="../../site/site/js/highlight.pack.js"></script>
        <script src="../../site/site/js/jquery-1.10.2.min.js"></script>
        <script src="../../site/js/base.js"></script>
        <script src="../../site/js/bootstrap-3.0.3.min.js"></script>
        <script src="../../site/js/highlight.pack.js"></script>
        <script src="../../site/js/jquery-1.10.2.min.js"></script>

        <div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="exampleModalLabel">Search</h4>
                    </div>
                    <div class="modal-body">
                        <p>
                            From here you can search these documents. Enter
                            your search terms below.
                        </p>
                        <form role="form">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
                            </div>
                        </form>
                        <div id="mkdocs-search-results"></div>
                    </div>
                    <div class="modal-footer">
                    </div>
                </div>
            </div>
        </div>

    </body>
</html>
